package com.jiyinit.web.core.activiti.vo;

import com.jiyinit.core.framework.base.util.Check;
import com.jiyinit.web.core.activiti.entity.TabCoreEvectionDealEntity;
import org.activiti.engine.history.HistoricTaskInstance;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by user1 on 2018/12/26.
 */
public class EveDealMindVo {

    /**
     * 任务key值
     */
    private String taskDefinitionKey;

    /**
     * 任务名称
     */
    private String taskName;

    /**
     * 是否同意
     */
    private String isAgree;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String createDate;

    /**
     * 处理意见
     */
    private String dealMindInfo;

    /**
     * 处理人姓名
     */
    private String dealUserName;


    public String getTaskDefinitionKey() {
        return taskDefinitionKey;
    }

    public void setTaskDefinitionKey(String taskDefinitionKey) {
        this.taskDefinitionKey = taskDefinitionKey;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getIsAgree() {
        return isAgree;
    }

    public void setIsAgree(String isAgree) {
        this.isAgree = isAgree;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getDealMindInfo() {
        return dealMindInfo;
    }

    public void setDealMindInfo(String dealMindInfo) {
        this.dealMindInfo = dealMindInfo;
    }

    public String getDealUserName() {
        return dealUserName;
    }

    public void setDealUserName(String dealUserName) {
        this.dealUserName = dealUserName;
    }

    public void convertFor(TabCoreEvectionDealEntity dealEntity){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        if(!Check.isNullObj(dealEntity)){
            Date createDate = dealEntity.getCreateDate();
            if(!Check.isNullObj(createDate)){
                this.createDate = sdf.format(createDate);
            }
            this.dealMindInfo = dealEntity.getDealInfo();
            this.isAgree = dealEntity.getIsAgree();
        }
    }
}
